<template>
  <el-dialog title="投保信息" :close-on-click-modal="false" append-to-body :visible.sync="visible" class="cu-dialog cu-dialog_center" lock-scroll width="880px">
    <el-row :gutter="15" class="">
      <el-form ref="elForm" :model="dataForm" size="small" label-width="100px" label-position="right" :rules="rules">
        <el-col :span="12" v-if="!isDetail && type !== 'campus'">
          <el-form-item label="校区品牌" prop="brand">
            <el-select v-model="dataForm.brand" placeholder="请选择校区品牌" filterable clearable required :style="{ width: '100%' }">
              <el-option :key="item.id" :label="item.fullName" :value="item.enCode" v-for="item in brandOptions" />
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="12" v-if="!isDetail && type !== 'campus'">
          <el-form-item label="校区名称" prop="campusId">
            <el-select v-model="dataForm.campusId" placeholder="请选择校区名称" filterable clearable required :style="{ width: '100%' }">
              <el-option v-for="(item, index) in campusOptions" :key="index" :label="item.fullName + '(面积：' + item.siteArea + ')'" :value="item.id"></el-option>
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="保险名称" prop="policyName">
            <el-select v-model="dataForm.policyName" placeholder="请选择保险名称" filterable clearable required :style="{ width: '100%' }">
              <el-option :key="item.enCode" :label="item.fullName" :value="item.enCode" v-for="item in policyNameOptions" />
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="投保单号" prop="policyNumber">
            <el-input v-model="dataForm.policyNumber" placeholder="请输入投保单号" clearable required :style="{ width: '100%' }"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="生效日期" prop="effectiveDate">
            <el-date-picker v-model="dataForm.effectiveDate" placeholder="请选择生效日期" clearable required :style="{ width: '100%' }" type="date" format="yyyy-MM-dd" value-format="timestamp"></el-date-picker>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="到期日期" prop="expirationDate">
            <el-date-picker v-model="dataForm.expirationDate" placeholder="请选择到期日期" clearable required :style="{ width: '100%' }" type="date" format="yyyy-MM-dd" value-format="timestamp"></el-date-picker>
          </el-form-item>
        </el-col>
        <el-col :span="24">
          <el-form-item label="投保公司" prop="insuranceCompany">
            <el-select v-model="dataForm.insuranceCompany" placeholder="请选择投保公司" filterable clearable required :style="{ width: '100%' }">
              <el-option :key="item.enCode" :label="item.fullName" :value="item.enCode" v-for="item in insuranceCompanyOptions" />
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="24">
          <el-form-item label="备注" prop="description">
            <el-input v-model="dataForm.description" placeholder="请对投保信息其他相关信息进行备注" show-word-limit :style="{ width: '100%' }" type="textarea" :autosize="{ minRows: 4, maxRows: 4 }"></el-input>
          </el-form-item>
        </el-col>
      </el-form>
    </el-row>
    <span slot="footer" class="dialog-footer">
      <el-button @click="visible = false">取 消</el-button>
      <el-button type="primary" @click="dataFormSubmit()" :loading="loading">确 定</el-button>
    </span>
  </el-dialog>
</template>
<script>
export { default } from './index.js'
</script>
